package com.kucowka.validators;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import com.kucowka.db.entities.User;

public class UserValidator implements ConstraintValidator<UserValid, Object> {

	private UserValid constraintAnnotation;

	@Override
	public void initialize(UserValid constraintAnnotation) {
		this.constraintAnnotation = constraintAnnotation;
	}

	@Override
	public boolean isValid(Object value, ConstraintValidatorContext context) {
		
		User user = (User)value;
		
		return user.getName().equals("Edek");
	}

}
